<template>
  <!-- 在根view中添加背景色样式 -->
  <view style="padding-top: 100rpx; background-color: #55aaff; min-height: 100vh;">
    <view class="text-area">
      <text>输入值：</text><input type="text" v-model="title" style="color: red;" />
    </view>
    <view class="text-area">
      <text>回传值：</text><input type="text" :value="callBackValue" style="color: yellow;" />
    </view>
    <comA :intent="title" class="com-a-box"></comA>
    <comB @callBackFun="callBack" class="com-b-box"></comB>
  </view>
</template>

<script>
import comA from '../../components/ComA.vue'
import comB from '../../components/ComB.vue'
export default {
  components: {
    comA,
    comB
  },
  data() {
    return {
      title: 'Hello',
      callBackValue: '0595-2788888'
    }
  },
  methods: {
    callBack(msg) {
      this.callBackValue = msg;
    }
  }
}
</script>

<style>
.text-area input {
  border: 1rpx solid #ddd;
  padding: 10rpx;
  border-radius: 4rpx;
  width: 60%; /* 优化输入框宽度 */
}
.com-a-box {
  background-color: skyblue;
  padding: 20rpx;
  border-radius: 8rpx;
  margin: 20rpx 0;
}
.com-b-box {
  background-color: lightgreen;
  padding: 20rpx;
  border-radius: 8rpx;
  margin: 20rpx 0;
}
/* 可选：增加页面内边距，避免内容贴边 */
page {
  padding: 0 20rpx;
}
</style>